<section class="title">
<?php if ($this->method == 'create'): ?>
	<h4><?php echo lang('escort_site_setting_create_title'); ?></h4>
<?php else: ?>
	<h4><?php echo sprintf(lang('escort_site_setting_edit_title'), $post->site_id); ?></h4>
<?php endif; ?>
</section>

<section class="item">
	
<?php echo form_open(uri_string(), 'class="crud"'); ?>
<div class="form_inputs" id="news-form">

	<fieldset>
	
		<ul>
			<li class="even">
				<label for="site_id"><?php echo lang('escort_site_setting_domain_label'); ?></label>
				<div class="input">					
					<?php echo form_dropdown('site_id', array(0 => lang('global:select-all')) + $sites, $post->site_id, 'disabled="disabled"') ?>
				</div>
			</li>
			<li class="odd">
				<label for="language_id"><?php echo lang('escort_site_setting_language_label'); ?></label>
				<div class="input">
					<?php echo multi_checkbox('language_id[]', $languages, explode(',', $post->main_site_language_ids))?>
				</div>
			</li>
			
			<?php
			if($siteSettingZones){
				$i= 0;
				foreach ($siteSettingZones as $siteSettingZone){
					$i++;
			?>
			
			<li class="even multi-item">
				<ul>
					<li>
						<label for="country_id"><?php echo lang('escort_site_setting_zone_label'); ?></label>
							<?php echo form_dropdown('country_id[]', array('0' => lang('escort_site_setting_zone_select_country_label')) + getCountryData_ioc(), $siteSettingZone->country_id, 'id="country_'.$i.'" class="country_select"') ?>
					</li>
					<li>
						<label for="region_id"><?php echo '&nbsp;'; ?></label>
						<div>
						<?php echo form_dropdown('region_id[]', array('0' => lang('escort_site_setting_zone_select_state_label')) + getStateData_ioc($siteSettingZone->country_id), $siteSettingZone->region_id, 'id="state_country_'.$i.'" class="state_select"') ?>
						</div>
					</li>
					<li id="province_state_country_<?php echo $i?>_wrapper" <?php echo $siteSettingZone->province_id?'':'style="display: none;"'?>>
						<label for="province_id"><?php echo '&nbsp;'; ?></label>
						<?php echo form_dropdown('province_id[]', array('0' => lang('escort_site_setting_zone_select_province_label')) + getProvinceData_ioc($siteSettingZone->country_id, $siteSettingZone->region_id), $siteSettingZone->province_id, 'id="province_state_country_'.$i.'" class="provice_select"') ?>
					</li>
					<li>
						<label for="city_id"><?php echo '&nbsp;'; ?></label>
						<?php echo form_dropdown('city_id[]', array('0' => lang('escort_site_setting_zone_select_city_label')) + getCityData_ioc($siteSettingZone->country_id, $siteSettingZone->region_id, $siteSettingZone->province_id ),  $siteSettingZone->city_id, 'id="city_state_country_'.$i.'" class="city_select"') ?>
					</li>
					<li class="delete-domain">
						<?php echo anchor('#', lang('global:delete'), array('class'=>'btn red delete', 'onclick' => 'return deleteZone(this)'))?>
					</li>
				</ul>
			</li>
			<?php
				}
			}else{
			?>
			
			<li class="even multi-item">
				<ul>
					<li>
						<label for="country_id"><?php echo lang('escort_site_setting_zone_label'); ?></label>
							<?php echo form_dropdown('country_id[]', array('0' => lang('escort_site_setting_zone_select_country_label')) + getCountryData_ioc(), '', 'id="country_1" class="country_select"') ?>
					</li>
					<li>
						<label for="region_id"><?php echo '&nbsp;'; ?></label>
						<div>
						<?php echo form_dropdown('region_id[]', array('0' => lang('escort_site_setting_zone_select_state_label')) + getStateData_ioc(0), '', 'id="state_country_1" class="state_select"') ?>
						</div>
					</li>
					<li id="province_state_country_1_wrapper" style="display: none;">
						<label for="province_id"><?php echo '&nbsp;'; ?></label>
						<?php echo form_dropdown('province_id[]', array('0' => lang('escort_site_setting_zone_select_province_label')) + getProvinceData_ioc(), '', 'id="province_state_country_1" class="provice_select"') ?>
					</li>
					<li>
						<label for="city_id"><?php echo '&nbsp;'; ?></label>
						<?php echo form_dropdown('city_id[]', array('0' => lang('escort_site_setting_zone_select_city_label')) + getCityData_ioc(), '', 'id="city_state_country_1" class="city_select"') ?>
					</li>
					<li class="delete-domain">
						<?php echo anchor('#', lang('global:delete'), array('class'=>'btn red delete', 'onclick' => 'return deleteZone(this)'))?>
					</li>
				</ul>
			</li>
			
			<?php
			} 
			?>
			<div id="add-more-zone-wrapper">
			</div>
			<li class="odd">
				<?php echo anchor('#', lang('escort_site_setting_add_more_label'), array('class'=>'btn red', 'id' => 'add-more-zone')); ?>
			</li>
			<li class="odd multi-item">
				<ul>
					<li>
						<label for="category_id"><?php echo lang('escort_site_setting_category_label'); ?></label>
						<?php echo form_dropdown('escort_category_code',  array(0 => lang('global:select-all')) + $categories, $post->escort_category_code) ?>
					</li>
					<li>
						<label for="sexual_orientation_code"><?php echo lang('escort_site_setting_sexual_orientation_label'); ?></label>
						<?php echo form_dropdown('sexual_orientation_code',  array(0 => lang('global:select-all')) + $sexualOrientations, $post->sexual_orientation_code) ?>
					</li>
					<li>
						<label for="escort_priority_id"><?php echo lang('escort_site_setting_priority_label'); ?></label>
						<?php echo form_dropdown('escort_priority_id',  array(0 => lang('global:select-all')) + $priorityOptions, $post->escort_priority_id) ?>
					</li>
				</ul>
			</li>
			
			<li class="even">
				<label for="price-selection"><?php echo lang('escort_site_setting_price_selection_label'); ?></label>
				<div class="input">
					<label for="price-selection"><?php echo lang('escort_site_setting_price_selection_min_label'); ?></label>
					<?php echo form_input('min_price_per_hour', htmlspecialchars_decode($post->min_price_per_hour), 'maxlength="100" id="min_price_per_hour"'); ?>
					<label for="price-selection"><?php echo lang('escort_site_setting_price_selection_max_label'); ?></label>
					<?php echo form_input('max_price_per_hour', htmlspecialchars_decode($post->max_price_per_hour), 'maxlength="100" id="max_price_per_hour"'); ?>
				</div>
			</li>
			<li>
				<fieldset id="filters">
					<legend><?php echo lang('escort_site_setting_physical_appearance_label');?></legend>
					<ul>
						<li class="odd multi-item">
							<ul>
								<li>
									<label for="hair_color_code"><?php echo lang('escort_site_setting_hair_label'); ?></label>
									<?php echo form_dropdown('hair_color_code', array('0'=> lang('escort_site_setting_hair_color_label')) + $hairColors, $post->hair_color_code) ?>
								</li>
								<li>
									<label for="hair_size_code"><?php echo '&nbsp;'; ?></label>
									<?php echo form_dropdown('hair_size_code', array('0'=> lang('escort_site_setting_hair_size_label')) + $hairSizes, $post->hair_size_code) ?>
								</li>
								<li>
									<label for="hair_style_code"><?php echo '&nbsp;'; ?></label>
									<?php echo form_dropdown('hair_style_code', array('0'=> lang('escort_site_setting_hair_style_label')) + $hairStyles, $post->hair_style_code) ?>
								</li>
							</ul>
						</li>
						<li class="even">
							<label for="eye_code"><?php echo lang('escort_site_setting_eye_code_label'); ?></label>
							<div class="input">
								<?php echo form_dropdown('eye_code', array('0'=> lang('escort_site_setting_eye_code_label')) + $eyeCodes, $post->eye_code) ?>
							</div>
						</li>
						<li class="odd">
							<label for="height"><?php echo lang('escort_site_setting_height_label'); ?></label>
							<div class="input">
								<?php echo form_dropdown('height', getHeightOptionData_ioc(), $post->height) ?>
							</div>
						</li>
						<li class="even">
							<label for="weight"><?php echo lang('escort_site_setting_weight_label'); ?></label>
							<div class="input">
								<?php echo form_dropdown('weight', getWeightOptionData_ioc(), $post->weight) ?>
							</div>
						</li>
						<li class="odd multi-item">
							<ul>
								<li>
									<label for="measure_1"><?php echo lang('escort_site_setting_measure_label'); ?></label>
									<?php echo form_dropdown('measure_1', getMeasureOptionData_ioc(), $post->measure_1) ?>
								</li>
								<li>
									<label for="measure_2"><?php echo '&nbsp;'; ?></label>
									<?php echo form_dropdown('measure_2', getMeasureOptionData_ioc(), $post->measure_2) ?>
								</li>
								<li>
									<label for="measure_3"><?php echo '&nbsp;'; ?></label>
									<?php echo form_dropdown('measure_3', getMeasureOptionData_ioc(), $post->measure_3) ?>
								</li>
							</ul>
						</li>
					</ul>
				</fieldset>
			</li>
		</ul>
	</fieldset>
</div>
<div class="buttons float-right padding-top">
<?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'save_exit', 'cancel'))); ?>
</div>
<?php echo form_close(); ?>
</section>
<div id='confirm'>
	<div class='header'><span><?php echo lang('escort_confirm')?></span></div>
	<div class='message'><?php echo lang('escort_banner_delete_zone_message')?></div>
		<div class='buttons'>
		<div class='no simplemodal-close'><?php echo lang('escort_confirm_no')?></div><div class='yes'><?php echo lang('escort_confirm_yes')?></div>
	</div>
</div>